sadasdas
select * from fatharhar where verilengaranti is null
exec sp_personel

select * from Persone
select top 1 * from fatharhar WITH(NOLOCK) order by RECID desc
 select top 1 * from stok where stokkodu= 'NFH.G161-2L05V'
select top 1000 * from fatharhar WITH(NOLOCK)  where verilengaranti<'2011-01-01' and recID<29000000 and verilengaranti is not null

dbcc traceon(610)
delete from fatharhar where verilengaranti<'2011-01-01' and recID<29000000 and verilengaranti is not null
dbcc traceoff(610)

dbcc traceoff(610)
delete top (1) from fatharhar where verilengaranti<'2011-01-01' and recID<29000000 and verilengaranti is not null


DBCC SHRINKFILE (data29_log, 1);

DECLARE @BatchSize INT,@Counter INT
SET @BatchSize = 1000

SET @Counter=0;
WHILE @BatchSize <> 0
BEGIN
    DELETE TOP (@BatchSize)
    FROM fatharhar where verilengaranti<'2011-01-01' and recID<29000000 and verilengaranti is not null
    SET @BatchSize = @@rowcount
    SET @Counter=@Counter+1;
    print @Counter*@BatchSize 
END  


DECLARE @BatchSize INT,@Counter INT,@DT DATETIME
SET @BatchSize = 1000

SET @Counter=0;
WHILE @BatchSize <> 0
BEGIN
	SET @DT=GETDATE();
    DELETE TOP (@BatchSize)
    FROM fatharhar where verilengaranti<'2011-01-01' and recID<29000000 and verilengaranti is not null
    SET @BatchSize = @@rowcount
    SET @Counter=@Counter+1;
    print CAST(@Counter*@BatchSize AS VARCHAR(20)) +' - '+CAST(DATEDIFF(SS,@DT,GETDATE()) AS VARCHAR(20))
END  

